/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dumbchat;

import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.concurrent.TimeUnit;
import org.pircbotx.hooks.ListenerAdapter;
import org.pircbotx.hooks.events.MessageEvent;

/**
 *
 * @author tangd
 */
public class MiscChat extends ListenerAdapter {
    public void onMessage(MessageEvent event) {
        String message = event.getMessage().trim();
        if(message.matches("!"+event.getBot().getNick())) {
            event.getBot().kick(event.getChannel(), event.getUser(), "PBBBBBBBBBBBBBBBBT");
        }
       /* else if(message.matches("!christmas")) {
            GregorianCalendar now = new GregorianCalendar();
            GregorianCalendar christmas = new GregorianCalendar();
            christmas.set(Calendar.MONTH, 11);
            christmas.set(Calendar.DAY_OF_MONTH, 25);
            if(christmas.before(now)) {
                christmas.add(Calendar.YEAR, 1);
            }
            else if(christmas.equals(now)) {
                event.respond("It's Christmas!");
            }
            christmas.set(Calendar.HOUR_OF_DAY, 0);
            christmas.set(Calendar.MINUTE, 0);
            christmas.set(Calendar.SECOND, 0);
            long diff = (christmas.getTimeInMillis() - now.getTimeInMillis())/1000;
            long days = (diff/86400);
            diff %= 86400;
            long hours = diff/3600;
            diff %= 3600;
            long minutes = diff/60;
            diff %=60;
            long seconds = diff;
            event.respond(String.format("There are %d days, %d hours, %d minutes, and %d seconds until Christmas", days, hours, minutes, seconds));
        }
        */
    }
}
